home *** CD-ROM | disk | FTP | other *** search
/ Ultra Pack / UltraComputing Partner Applications.iso / SunLabs / tclTK / src / tk4.0 / tkUnix.c < prev    next >
C/C++ Source or Header  |  1995-06-24  |  1KB  |  51 lines

  1. /* 
  2.  * tkUnix.c --
  3.  *
  4.  *    This file contains procedures that are UNIX/X-specific, and
  5.  *    will probably have to be written differently for Windows or
  6.  *    Macintosh platforms.
  7.  *
  8.  * Copyright (c) 1995 Sun Microsystems, Inc.
  9.  *
  10.  * See the file "license.terms" for information on usage and redistribution
  11.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  12.  */
  13.  
  14. static char sccsid[] = "%Z% %M% %I% %E% %U%";
  15.  
  16. #include <tkInt.h>
  17.  
  18. /*
  19.  *----------------------------------------------------------------------
  20.  *
  21.  * TkGetServerInfo --
  22.  *
  23.  *    Given a window, this procedure returns information about
  24.  *    the window server for that window.  This procedure provides
  25.  *    the guts of the "winfo server" command.
  26.  *
  27.  * Results:
  28.  *    None.
  29.  *
  30.  * Side effects:
  31.  *    None.
  32.  *
  33.  *----------------------------------------------------------------------
  34.  */
  35.  
  36. void
  37. TkGetServerInfo(interp, tkwin)
  38.     Tcl_Interp *interp;        /* The server information is returned in
  39.                  * this interpreter's result. */
  40.     Tk_Window tkwin;        /* Token for window;  this selects a
  41.                  * particular display and server. */
  42. {
  43.     char buffer[50], buffer2[50];
  44.  
  45.     sprintf(buffer, "X%dR%d ", ProtocolVersion(Tk_Display(tkwin)),
  46.         ProtocolRevision(Tk_Display(tkwin)));
  47.     sprintf(buffer2, " %d", VendorRelease(Tk_Display(tkwin)));
  48.     Tcl_AppendResult(interp, buffer, ServerVendor(Tk_Display(tkwin)),
  49.         buffer2, (char *) NULL);
  50. }
  51.